home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacApp Release 10 / MacApp Release 10 - HD Ready / Libraries / Views / Includes / UKeySelectionBehavior.h < prev    next >
Encoding:
Text File  |  1996-04-03  |  1.4 KB  |  53 lines  |  [TEXT/MPS ]

  1. // UKeySelectionBehavior.h 
  2. // Copyright © 1985-96 by Apple Computer, Inc. All rights reserved.
  3.  
  4. #ifndef __UKEYSELECTIONBEHAVIOR__
  5. #define __UKEYSELECTIONBEHAVIOR__
  6.  
  7. // MacApp
  8.  
  9. #ifndef __UBEHAVIOR__
  10. #include "UBehavior.h"
  11. #endif
  12.  
  13.  
  14. //----------------------------------------------------------------------------------------
  15. // class TKeySelectionBehavior
  16. //----------------------------------------------------------------------------------------
  17.  
  18. class TKeySelectionBehavior : public TBehavior
  19. {
  20.     MA_DECLARE_CLASS;
  21.     
  22. protected: // fields
  23.     CStr255 fKeySequence;
  24.     long fTimeOutInterval;
  25.     long fLastKeyUpTime;
  26.     
  27. public: // member functions
  28.  
  29.     TKeySelectionBehavior();
  30.         // Constructor
  31.     virtual ~TKeySelectionBehavior();
  32.         // Destructor
  33.         
  34.     void IKeySelectionBehavior(IDType itsIdentifier);
  35.         
  36.     virtual void DoKeyEvent(TToolboxEvent* event);
  37.         // Accumulate the keystrokes.
  38.  
  39.     virtual void DoKeySelection(const CStr255& keySequence);
  40.         // Called with a the current sequence of characters that have been typed in
  41.         // 'keySequence'. Derived classes can override. Default action is to called
  42.         // 'DoKeySelection' on the fOwner field of this behavior.
  43.         
  44.     virtual void DoKeyUp(TToolboxEvent* event);
  45.         // Set time of keyUp events for timing out and reseting the CString of keys hit.
  46.                       
  47.     virtual void SetTimeOutInterval(long timeOutInterval);
  48.         // Change the default time out interval. Default is the value of auto-key
  49.         // threshold.
  50. };
  51.  
  52. #endif
  53.